#ifndef FIGHT_H
#define FIGHT_H

#include <QWidget>
#include "dboperator.h"
#include "console.h"
#include <QTimer>
#include <QDateTime>
#include <QThread>
#include <QTextCharFormat>
#include <QColor>
#include <QRgb>
#include <QMessageBox>

namespace Ui {
class Fight;
}

class Fight : public QWidget
{
    Q_OBJECT

public:
    explicit Fight(QWidget *parent, int id);
    ~Fight();

    template<typename T>
    void show_pic(QImage *img, T tool);

    void boss_act();

    void show_skill();

    void skill_calculate_and_show(int no);   // 用的第几个技能

    void Sleep(int msec);

    void success();

    void defeat();

    void closeEvent(QCloseEvent* );
private slots:
    void on_skill_1_clicked();

    void on_skill_2_clicked();

    void on_skill_4_clicked();

    void on_skill_3_clicked();

signals:
    clo();

private:
    Ui::Fight *ui;
    int id;
    DbOperator* dbase;
    container trainer;
    console con;

    pokemon fight_pet;
    int curhp;
    QStringList skill;

    int bossMaxHp;
    int bossCurHp;
    int bossAttack;
    int bossDefense;
    int order;           // 事件次序

    QString boss_state[4];
    int boss_skill_num[4];

    bool clickRight;
};

#endif // FIGHT_H
